<template>
	<view>
		<view class="items" >
			<view class="flex_jc_sb">
				<view class="flex">
					<view class="flex">
						<image class="headimg" :src="data.userInfo.user.avatar_text" mode="aspectFill"></image>
						<view class="name">
							{{data.userInfo.user.nickname}}
						</view>
					</view>
					<view class="tip">
						第{{data.userInfo.user.meeting_num}}期会员
					</view>
				</view>
				<view class="btns">
					{{data.userInfo.type==1?'合作':'需求'}}
				</view>
			</view>
			<view class="text">
				{{data.userInfo.content}}
			</view>
			<view class="images">
				<image v-for="(item,index) in data.userInfo.images_arr" 
				@click.stop="$previewImage(data.userInfo.images_arr,index)"
				:src="item" mode="widthFix"></image>
			</view>
		</view>
		<view class="" style="height: 266rpx;">
			
		</view>

		<view class="footer_kf">
			<view class="cont flex_jc_sb">
				<view class="kf">
					<image src="/static/fx.png" mode=""></image>
					<view class="">
						分享
					</view>
					<button class="adsbtn" open-type="share"></button>
				</view>
				<view class="flex" style="width: 600rpx;">
					<view class="btn" @click="$phoneCall(data.userInfo.mobile)" style="margin-right: 20rpx;">
						<uni-icons type="phone-filled" color="#fff" size="18"></uni-icons>
						联系TA
					</view>
					<view v-if="data.userInfo.wechat" class="btn b1" @click="$copyFun(data.userInfo.wechat,'微信已复制')">
						<uni-icons type="weixin" color="#fff" size="18"></uni-icons>
						联系TA
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script setup>
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app'
	import {
		detailBusinessList
	} from '@/common/http.api.js';
	import {
		reactive,
		ref
	} from 'vue';
	const data = reactive({
		userInfo: {
			user:{}
		}
	})
	const id = ref(0)
	onShow(()=>{
		detailBusinessList({
			id: id.value
		}).then(res => {
			data.userInfo = res.data
		})
		// if(uni.getStorageSync('cirleToken')){
			
		// }else{
		// 	uni.navigateTo({
		// 		url: '/pages/login/login'
		// 	})	
		// }
	})
	onLoad((option) => {
		id.value = option.id
	})
</script>
<script>
	export default {
		onShareAppMessage() {
			return {
				title: '商机详情！',
				path: `/pages/business/businessdetail?id=${this.id}`,
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #F7F8FC;
	}

	.items {
		margin: 20rpx auto;
		width: 710rpx;
		background: #FFFFFF;
		border-radius: 20rpx 20rpx 20rpx 20rpx;
		padding: 20rpx;
		box-sizing: border-box;

		.headimg {
			width: 70rpx;
			height: 70rpx;
			border-radius: 35rpx;
		}

		.name {
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 32rpx;
			color: #000000;
			margin-left: 10rpx;
		}

		.tip {
			margin-left: 10rpx;
			height: 40rpx;
			background: linear-gradient(223deg, #FFC393 0%, #FFE9D9 100%);
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			border: 1px solid #F9B781;
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 20rpx;
			color: #8A3E00;
			line-height: 40rpx;
			text-align: center;
			padding: 0rpx 6rpx;
		}

		.btns {
			width: 100rpx;
			height: 48rpx;
			background: #FFFFFF;
			border-radius: 40rpx 40rpx 40rpx 40rpx;
			border: 1px solid #0756FF;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: #0756FF;
			line-height: 48rpx;
			text-align: center;
		}

		.text {
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: #000000;
			margin: 20rpx auto;
		}

		.images {
			image {
				width: 670rpx;
				border-radius: 20rpx;
			}
		}
	}


	.footer_kf {
		width: 750rpx;
		height: 120rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 1px 10rpx 0rpx rgba(0, 0, 0, 0.2);
		position: fixed;
		bottom: 0%;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);

		.cont {
			padding: 10rpx 30rpx 10rpx 40rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			height: 120rpx;
			color: #000000;

			.kf {
				width: 60rpx;
				height: 100rpx;
				position: relative;

				image {
					width: 48rpx;
					height: 48rpx;
				}

				font-family: PingFang SC,
				PingFang SC;
				font-weight: 500;
				font-size: 24rpx;
				color: #545454;

				.adsbtn {
					width: 100rpx;
					height: 100rpx;
					position: absolute;
					top: 0%;
					opacity: 0;
				}
			}

			.btn {
				width: 600rpx;
				height: 80rpx;
				background: #0756FF;
				border-radius: 40rpx 40rpx 40rpx 40rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 30rpx;
				color: #FFFFFF;
				line-height: 80rpx;
				text-align: center;
			}

			.b1 {
				background: #08C985;
			}
		}
	}
</style>